<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MNNKit: MNNFaceDetection/iOS/MNNFaceDetection/Pods/MNN/MNN.framework/Headers/expr/expr/Executor.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MNNKit
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">MNN Kit SDK</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ff51bd0b7841751e6292791fdaa2b577.html">MNNFaceDetection</a></li><li class="navelem"><a class="el" href="dir_afc4351b0ff58faa23b45bf1feab612f.html">iOS</a></li><li class="navelem"><a class="el" href="dir_3aa9bd88010d07c3276bd22be45efe2a.html">MNNFaceDetection</a></li><li class="navelem"><a class="el" href="dir_2455bb6014d6030fbf6ab7e5d1a85dd5.html">Pods</a></li><li class="navelem"><a class="el" href="dir_fa47a86aecfce62b7301882476bba36d.html">MNN</a></li><li class="navelem"><a class="el" href="dir_b58aff5056364bfb9c8563ac291c455d.html">MNN.framework</a></li><li class="navelem"><a class="el" href="dir_d7ccca72d604790a8d4c14872eb841a0.html">Headers</a></li><li class="navelem"><a class="el" href="dir_a378c7a85f9ffe6bc5867d93d9dc9ba3.html">expr</a></li><li class="navelem"><a class="el" href="dir_0986baab01985d482909d96931a07532.html">expr</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Executor.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_executor_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//  Executor.hpp</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//  MNN</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//  Created by MNN on 2019/07/25.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//  Copyright © 2018, Alibaba Group Holding Limited</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef Executor_hpp</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define Executor_hpp</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;MNN/ErrorCode.hpp&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;MNN/expr/Expr.hpp&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;MNN/Tensor.hpp&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;set&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;MNN/MNNForwardType.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_m_n_n.html">MNN</a> {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">class </span>Backend;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">class </span>Execution;</div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="namespace_m_n_n_1_1_express.html">   20</a></span>&#160;<span class="keyword">namespace </span>Express {</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html">   21</a></span>&#160;<span class="keyword">class </span><a class="code" href="_m_n_n_define_8h.html#a692428e2a0af8ffb79376d223a0695ab">MNN_PUBLIC</a> <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html">Executor</a> {</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html">   23</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html">ComputeCache</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="keywordtype">void</span> setShapeDirty();</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keywordtype">void</span> setContentDirty();</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        <a class="code" href="namespace_m_n_n.html#a6814f7688a6a1ba4245f3ec5f4773241">ErrorCode</a> compute();</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        <a class="code" href="namespace_m_n_n.html#a6814f7688a6a1ba4245f3ec5f4773241">ErrorCode</a> resize();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        <a class="code" href="class_m_n_n_1_1_tensor.html">Tensor</a>* output(<a class="code" href="namespace_m_n_n_1_1_express.html#a152ce5be99dce88bb7ede3838075df79">EXPRP</a> outputExpr, <span class="keywordtype">int</span> index, <span class="keywordtype">bool</span> host = <span class="keyword">true</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <span class="keywordtype">void</span> dup(<a class="code" href="namespace_m_n_n_1_1_express.html#a152ce5be99dce88bb7ede3838075df79">EXPRP</a> src, <a class="code" href="namespace_m_n_n_1_1_express.html#a152ce5be99dce88bb7ede3838075df79">EXPRP</a> dst);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="keywordtype">void</span> recycle(<a class="code" href="class_m_n_n_1_1_express_1_1_expr.html">Expr</a>* expr);</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html">   33</a></span>&#160;        <span class="keyword">struct </span><a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html">TensorContent</a> {</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html#ab39151cd195410f588697ef339132535">   34</a></span>&#160;            std::shared_ptr&lt;Tensor&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html#ab39151cd195410f588697ef339132535">tensor</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html#a3793e54be5a591d99dd0661fa34559ed">   35</a></span>&#160;            <span class="keywordtype">int</span> refCount = 0;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            <span class="keywordtype">void</span> reset();</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        };</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html">   38</a></span>&#160;        <span class="keyword">struct </span><a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html">Unit</a> {</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a673abf60f12ae38925057bd339de67cd">   39</a></span>&#160;            std::vector&lt;Tensor*&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a673abf60f12ae38925057bd339de67cd">inputs</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a59f5f2d5a8e43ddece623ec932e0eae3">   40</a></span>&#160;            std::vector&lt;bool&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a59f5f2d5a8e43ddece623ec932e0eae3">inputFromCache</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a5abf388ecbe0a180fc08e3fed580c8c0">   41</a></span>&#160;            std::vector&lt;Tensor*&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a5abf388ecbe0a180fc08e3fed580c8c0">outputs</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a091bf8f5a1a802ab1b872a6a0859455b">   42</a></span>&#160;            <span class="keyword">const</span> <a class="code" href="class_m_n_n_1_1_express_1_1_expr.html">Expr</a>* <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a091bf8f5a1a802ab1b872a6a0859455b">origin</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#af6f3ab4b987314774580dfbb3f841a83">   43</a></span>&#160;            std::shared_ptr&lt;Execution&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#af6f3ab4b987314774580dfbb3f841a83">exe</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        };</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keyword">static</span> <span class="keywordtype">void</span> create(<span class="keyword">const</span> std::vector&lt;EXPRP&gt;&amp; outputs, std::map&lt;EXPRP, ComputeCache::Unit&gt;&amp; units, std::set&lt;std::shared_ptr&lt;Executor::ComputeCache&gt;&gt;&amp;&amp; inputCaches, std::vector&lt;ComputeCache::TensorContent&gt;&amp;&amp; tensors, std::shared_ptr&lt;Backend&gt; bn, std::shared_ptr&lt;Backend&gt; backendBn);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        ~<a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html"> ComputeCache</a>();</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordtype">void</span> addLink(std::shared_ptr&lt;ComputeCache&gt; cache);</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a2d9c460d8334945f4acad234586b7bc5">   49</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a2d9c460d8334945f4acad234586b7bc5">valid</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            <span class="keywordflow">return</span> !mOutputTensors.empty();</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        }</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">private</span>:</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ac2b03ae722001e0ec790214814c6bf7b">   53</a></span>&#160;        <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html">ComputeCache</a>(){};</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        std::set&lt;std::shared_ptr&lt;ComputeCache&gt;&gt; mInputs;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="comment">// First is Host Tensor, Second is Device Tensor</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a7f3cc537175c6de5d06fc8ee8a5cd4ef">   56</a></span>&#160;        std::map&lt;Expr*, std::vector&lt;std::pair&lt;Tensor*, Tensor*&gt;&gt;&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a7f3cc537175c6de5d06fc8ee8a5cd4ef">mOutputTensors</a>;</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a9432d52e951d2fd67df219b1e454e447">   57</a></span>&#160;        std::vector&lt;TensorContent&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a9432d52e951d2fd67df219b1e454e447">mTensors</a>;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a05f7864fd3b725d28b773ba58f14d364">   58</a></span>&#160;        std::vector&lt;Unit&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a05f7864fd3b725d28b773ba58f14d364">mUnits</a>;</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ae0f1998666270f098c4928937dbdbce0">   59</a></span>&#160;        std::vector&lt;std::weak_ptr&lt;ComputeCache&gt;&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ae0f1998666270f098c4928937dbdbce0">mLinks</a>;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a0ef803d09e4564f6ca381d261eff25e2">   60</a></span>&#160;        <span class="keywordtype">bool</span> mContentDirty = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ab97e0eaafbc670ed58bf4575f2092acf">   61</a></span>&#160;        <span class="keywordtype">bool</span> mShapeDirty = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a08e7bc90538fe45fd5da3c0e27838079">   62</a></span>&#160;        std::shared_ptr&lt;Backend&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a08e7bc90538fe45fd5da3c0e27838079">mBackend</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ac2888787a8ee5b0ad449bff33032e2a2">   63</a></span>&#160;        std::shared_ptr&lt;Backend&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ac2888787a8ee5b0ad449bff33032e2a2">mBackupBackend</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    };</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html">   65</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html">Requirement</a> {</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a047762336104f81c9f9c513cceb75c55">   66</a></span>&#160;        std::vector&lt;bool&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a047762336104f81c9f9c513cceb75c55">contentNeedContent</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#afdaa0e70aa42008f6e50c563e72dc03f">   67</a></span>&#160;        std::vector&lt;bool&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#afdaa0e70aa42008f6e50c563e72dc03f">shapeNeedContent</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a44bfa7c1456f415b8915e46fbe45fa63">   68</a></span>&#160;        std::vector&lt;bool&gt; <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a44bfa7c1456f415b8915e46fbe45fa63">supportError</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    };</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    ~<a class="code" href="class_m_n_n_1_1_express_1_1_executor.html">Executor</a>();</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html">Requirement</a> getRequirement(<a class="code" href="class_m_n_n_1_1_express_1_1_expr.html">Expr</a>* expr) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="namespace_m_n_n.html#a6814f7688a6a1ba4245f3ec5f4773241">ErrorCode</a> computeInfo(<a class="code" href="class_m_n_n_1_1_express_1_1_expr.html">Expr</a>* expr);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordtype">void</span> makeCache(std::vector&lt;EXPRP&gt; expr);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <a class="code" href="namespace_m_n_n.html#a6814f7688a6a1ba4245f3ec5f4773241">ErrorCode</a> runCache(std::shared_ptr&lt;ComputeCache&gt; cache);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">void</span> setGlobalExecutorConfig(<a class="code" href="_m_n_n_forward_type_8h.html#ab63ddb976d555083197683a1b1940870">MNNForwardType</a> type, <span class="keyword">const</span> BackendConfig&amp; config, <span class="keywordtype">int</span> numberThread);</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6">   76</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6">GCFlag</a> {</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6a8f4146467fbff72c4b715a70b9915f49">   77</a></span>&#160;        <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6a8f4146467fbff72c4b715a70b9915f49">FULL</a>,</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6a2b74c0db0caf520e8e8ad816345f30a0">   78</a></span>&#160;        PART</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    };</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordtype">void</span> gc(GCFlag flag = FULL);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keyword">static</span> std::shared_ptr&lt;Executor&gt; getGlobalExecutor();</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordtype">void</span> resetProfile();</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordtype">void</span> dumpProfile();</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordtype">void</span> addOpCostTime(<span class="keywordtype">int</span> op, <span class="keywordtype">float</span> costTime);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">class </span>Profiler;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keywordtype">void</span> _addToCache(<span class="keyword">const</span> std::vector&lt;std::shared_ptr&lt;ComputeCache&gt;&gt;&amp; caches);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordtype">void</span> _resetCache();</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordtype">void</span> _visit(<a class="code" href="namespace_m_n_n_1_1_express.html#a152ce5be99dce88bb7ede3838075df79">EXPRP</a> expr, std::map&lt;EXPRP, ComputeCache::Unit&gt;&amp; units, std::set&lt;std::shared_ptr&lt;Executor::ComputeCache&gt;&gt;&amp; inputCaches, std::vector&lt;ComputeCache::TensorContent&gt;&amp; tensors);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html">Executor</a>(std::shared_ptr&lt;Backend&gt; backend);</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a9d1bde34f7f5e80caf9bbf478e6e1d34">   92</a></span>&#160;    std::shared_ptr&lt;Backend&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a9d1bde34f7f5e80caf9bbf478e6e1d34">mBackend</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a957abb59be21f14666b255e1dcf2e235">   93</a></span>&#160;    std::shared_ptr&lt;Backend&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a957abb59be21f14666b255e1dcf2e235">mBackupBackend</a>;</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a801194aa6479649ce7936583fd10d109">   94</a></span>&#160;    std::mutex <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a801194aa6479649ce7936583fd10d109">mMutex</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a95ff5f816017c2d568db8dc4f53d8d7d">   95</a></span>&#160;    std::vector&lt;std::shared_ptr&lt;Tensor&gt;&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a95ff5f816017c2d568db8dc4f53d8d7d">mStack</a>;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a67a93b8171bd826e4a4cf672dbb6bf09">   96</a></span>&#160;    std::vector&lt;Tensor*&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a67a93b8171bd826e4a4cf672dbb6bf09">mInputs</a>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#af108a942d19862cb51ee774f625db366">   97</a></span>&#160;    std::vector&lt;Tensor*&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#af108a942d19862cb51ee774f625db366">mOutputs</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_m_n_n_1_1_express_1_1_executor.html#a8816dd9b3c5da79495100f8aa35e0807">   98</a></span>&#160;    std::shared_ptr&lt;Profiler&gt; <a class="code" href="class_m_n_n_1_1_express_1_1_executor.html#a8816dd9b3c5da79495100f8aa35e0807">mProfiler</a>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;};</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;} <span class="comment">// namespace Express</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;} <span class="comment">// namespace MNN</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="anamespace_m_n_n_html"><div class="ttname"><a href="namespace_m_n_n.html">MNN</a></div><div class="ttdef"><b>Definition:</b> AutoTime.hpp:16</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_a05f7864fd3b725d28b773ba58f14d364"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a05f7864fd3b725d28b773ba58f14d364">MNN::Express::Executor::ComputeCache::mUnits</a></div><div class="ttdeci">std::vector&lt; Unit &gt; mUnits</div><div class="ttdef"><b>Definition:</b> Executor.hpp:58</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a9d1bde34f7f5e80caf9bbf478e6e1d34"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a9d1bde34f7f5e80caf9bbf478e6e1d34">MNN::Express::Executor::mBackend</a></div><div class="ttdeci">std::shared_ptr&lt; Backend &gt; mBackend</div><div class="ttdef"><b>Definition:</b> Executor.hpp:92</div></div>
<div class="ttc" id="a_m_n_n_forward_type_8h_html_ab63ddb976d555083197683a1b1940870"><div class="ttname"><a href="_m_n_n_forward_type_8h.html#ab63ddb976d555083197683a1b1940870">MNNForwardType</a></div><div class="ttdeci">MNNForwardType</div><div class="ttdef"><b>Definition:</b> MNNForwardType.h:14</div></div>
<div class="ttc" id="anamespace_m_n_n_html_a6814f7688a6a1ba4245f3ec5f4773241"><div class="ttname"><a href="namespace_m_n_n.html#a6814f7688a6a1ba4245f3ec5f4773241">MNN::ErrorCode</a></div><div class="ttdeci">ErrorCode</div><div class="ttdef"><b>Definition:</b> ErrorCode.hpp:13</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html">MNN::Express::Executor::ComputeCache::Unit</a></div><div class="ttdef"><b>Definition:</b> Executor.hpp:38</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content_html_ab39151cd195410f588697ef339132535"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html#ab39151cd195410f588697ef339132535">MNN::Express::Executor::ComputeCache::TensorContent::tensor</a></div><div class="ttdeci">std::shared_ptr&lt; Tensor &gt; tensor</div><div class="ttdef"><b>Definition:</b> Executor.hpp:34</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html">MNN::Express::Executor</a></div><div class="ttdef"><b>Definition:</b> Executor.hpp:21</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_ae0f1998666270f098c4928937dbdbce0"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ae0f1998666270f098c4928937dbdbce0">MNN::Express::Executor::ComputeCache::mLinks</a></div><div class="ttdeci">std::vector&lt; std::weak_ptr&lt; ComputeCache &gt; &gt; mLinks</div><div class="ttdef"><b>Definition:</b> Executor.hpp:59</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html">MNN::Express::Executor::ComputeCache</a></div><div class="ttdef"><b>Definition:</b> Executor.hpp:23</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a2eefc03f52558051e9d9e9d02adab0c6a8f4146467fbff72c4b715a70b9915f49"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6a8f4146467fbff72c4b715a70b9915f49">MNN::Express::Executor::FULL</a></div><div class="ttdeci">@ FULL</div><div class="ttdef"><b>Definition:</b> Executor.hpp:77</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_requirement_html_a047762336104f81c9f9c513cceb75c55"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a047762336104f81c9f9c513cceb75c55">MNN::Express::Executor::Requirement::contentNeedContent</a></div><div class="ttdeci">std::vector&lt; bool &gt; contentNeedContent</div><div class="ttdef"><b>Definition:</b> Executor.hpp:66</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_af108a942d19862cb51ee774f625db366"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#af108a942d19862cb51ee774f625db366">MNN::Express::Executor::mOutputs</a></div><div class="ttdeci">std::vector&lt; Tensor * &gt; mOutputs</div><div class="ttdef"><b>Definition:</b> Executor.hpp:97</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_requirement_html"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html">MNN::Express::Executor::Requirement</a></div><div class="ttdef"><b>Definition:</b> Executor.hpp:65</div></div>
<div class="ttc" id="a_m_n_n_define_8h_html_a692428e2a0af8ffb79376d223a0695ab"><div class="ttname"><a href="_m_n_n_define_8h.html#a692428e2a0af8ffb79376d223a0695ab">MNN_PUBLIC</a></div><div class="ttdeci">#define MNN_PUBLIC</div><div class="ttdef"><b>Definition:</b> MNNDefine.h:67</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_expr_html"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_expr.html">MNN::Express::Expr</a></div><div class="ttdef"><b>Definition:</b> Expr.hpp:171</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_a9432d52e951d2fd67df219b1e454e447"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a9432d52e951d2fd67df219b1e454e447">MNN::Express::Executor::ComputeCache::mTensors</a></div><div class="ttdeci">std::vector&lt; TensorContent &gt; mTensors</div><div class="ttdef"><b>Definition:</b> Executor.hpp:57</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_requirement_html_afdaa0e70aa42008f6e50c563e72dc03f"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#afdaa0e70aa42008f6e50c563e72dc03f">MNN::Express::Executor::Requirement::shapeNeedContent</a></div><div class="ttdeci">std::vector&lt; bool &gt; shapeNeedContent</div><div class="ttdef"><b>Definition:</b> Executor.hpp:67</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a67a93b8171bd826e4a4cf672dbb6bf09"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a67a93b8171bd826e4a4cf672dbb6bf09">MNN::Express::Executor::mInputs</a></div><div class="ttdeci">std::vector&lt; Tensor * &gt; mInputs</div><div class="ttdef"><b>Definition:</b> Executor.hpp:96</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a957abb59be21f14666b255e1dcf2e235"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a957abb59be21f14666b255e1dcf2e235">MNN::Express::Executor::mBackupBackend</a></div><div class="ttdeci">std::shared_ptr&lt; Backend &gt; mBackupBackend</div><div class="ttdef"><b>Definition:</b> Executor.hpp:93</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a95ff5f816017c2d568db8dc4f53d8d7d"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a95ff5f816017c2d568db8dc4f53d8d7d">MNN::Express::Executor::mStack</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; Tensor &gt; &gt; mStack</div><div class="ttdef"><b>Definition:</b> Executor.hpp:95</div></div>
<div class="ttc" id="anamespace_m_n_n_1_1_express_html_a152ce5be99dce88bb7ede3838075df79"><div class="ttname"><a href="namespace_m_n_n_1_1_express.html#a152ce5be99dce88bb7ede3838075df79">MNN::Express::EXPRP</a></div><div class="ttdeci">std::shared_ptr&lt; Expr &gt; EXPRP</div><div class="ttdef"><b>Definition:</b> Expr.hpp:28</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html_af6f3ab4b987314774580dfbb3f841a83"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#af6f3ab4b987314774580dfbb3f841a83">MNN::Express::Executor::ComputeCache::Unit::exe</a></div><div class="ttdeci">std::shared_ptr&lt; Execution &gt; exe</div><div class="ttdef"><b>Definition:</b> Executor.hpp:43</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a801194aa6479649ce7936583fd10d109"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a801194aa6479649ce7936583fd10d109">MNN::Express::Executor::mMutex</a></div><div class="ttdeci">std::mutex mMutex</div><div class="ttdef"><b>Definition:</b> Executor.hpp:94</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content_html"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_tensor_content.html">MNN::Express::Executor::ComputeCache::TensorContent</a></div><div class="ttdef"><b>Definition:</b> Executor.hpp:33</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_tensor_html"><div class="ttname"><a href="class_m_n_n_1_1_tensor.html">MNN::Tensor</a></div><div class="ttdef"><b>Definition:</b> Tensor.hpp:25</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_ac2888787a8ee5b0ad449bff33032e2a2"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#ac2888787a8ee5b0ad449bff33032e2a2">MNN::Express::Executor::ComputeCache::mBackupBackend</a></div><div class="ttdeci">std::shared_ptr&lt; Backend &gt; mBackupBackend</div><div class="ttdef"><b>Definition:</b> Executor.hpp:63</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_a08e7bc90538fe45fd5da3c0e27838079"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a08e7bc90538fe45fd5da3c0e27838079">MNN::Express::Executor::ComputeCache::mBackend</a></div><div class="ttdeci">std::shared_ptr&lt; Backend &gt; mBackend</div><div class="ttdef"><b>Definition:</b> Executor.hpp:62</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html_a673abf60f12ae38925057bd339de67cd"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a673abf60f12ae38925057bd339de67cd">MNN::Express::Executor::ComputeCache::Unit::inputs</a></div><div class="ttdeci">std::vector&lt; Tensor * &gt; inputs</div><div class="ttdef"><b>Definition:</b> Executor.hpp:39</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_a7f3cc537175c6de5d06fc8ee8a5cd4ef"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a7f3cc537175c6de5d06fc8ee8a5cd4ef">MNN::Express::Executor::ComputeCache::mOutputTensors</a></div><div class="ttdeci">std::map&lt; Expr *, std::vector&lt; std::pair&lt; Tensor *, Tensor * &gt; &gt; &gt; mOutputTensors</div><div class="ttdef"><b>Definition:</b> Executor.hpp:56</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a2eefc03f52558051e9d9e9d02adab0c6"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a2eefc03f52558051e9d9e9d02adab0c6">MNN::Express::Executor::GCFlag</a></div><div class="ttdeci">GCFlag</div><div class="ttdef"><b>Definition:</b> Executor.hpp:76</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html_a5abf388ecbe0a180fc08e3fed580c8c0"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a5abf388ecbe0a180fc08e3fed580c8c0">MNN::Express::Executor::ComputeCache::Unit::outputs</a></div><div class="ttdeci">std::vector&lt; Tensor * &gt; outputs</div><div class="ttdef"><b>Definition:</b> Executor.hpp:41</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html_a59f5f2d5a8e43ddece623ec932e0eae3"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a59f5f2d5a8e43ddece623ec932e0eae3">MNN::Express::Executor::ComputeCache::Unit::inputFromCache</a></div><div class="ttdeci">std::vector&lt; bool &gt; inputFromCache</div><div class="ttdef"><b>Definition:</b> Executor.hpp:40</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_html_a2d9c460d8334945f4acad234586b7bc5"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor_1_1_compute_cache.html#a2d9c460d8334945f4acad234586b7bc5">MNN::Express::Executor::ComputeCache::valid</a></div><div class="ttdeci">bool valid() const</div><div class="ttdef"><b>Definition:</b> Executor.hpp:49</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit_html_a091bf8f5a1a802ab1b872a6a0859455b"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_compute_cache_1_1_unit.html#a091bf8f5a1a802ab1b872a6a0859455b">MNN::Express::Executor::ComputeCache::Unit::origin</a></div><div class="ttdeci">const Expr * origin</div><div class="ttdef"><b>Definition:</b> Executor.hpp:42</div></div>
<div class="ttc" id="astruct_m_n_n_1_1_express_1_1_executor_1_1_requirement_html_a44bfa7c1456f415b8915e46fbe45fa63"><div class="ttname"><a href="struct_m_n_n_1_1_express_1_1_executor_1_1_requirement.html#a44bfa7c1456f415b8915e46fbe45fa63">MNN::Express::Executor::Requirement::supportError</a></div><div class="ttdeci">std::vector&lt; bool &gt; supportError</div><div class="ttdef"><b>Definition:</b> Executor.hpp:68</div></div>
<div class="ttc" id="aclass_m_n_n_1_1_express_1_1_executor_html_a8816dd9b3c5da79495100f8aa35e0807"><div class="ttname"><a href="class_m_n_n_1_1_express_1_1_executor.html#a8816dd9b3c5da79495100f8aa35e0807">MNN::Express::Executor::mProfiler</a></div><div class="ttdeci">std::shared_ptr&lt; Profiler &gt; mProfiler</div><div class="ttdef"><b>Definition:</b> Executor.hpp:98</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
